/* eslint-disable no-unused-vars */
import { drawNode, isValidWorkstepDoData, setRectColor, isValidWorkstepDoVideo, formatContent } from './utility';
const name = 'messageSure';
const attr = {
	rectColor: '#F6A3A1'
};

const drawShape = function (parentNode, element, textRenderer, eventBus, store) {
	const taskId = element.businessObject.taskId || element.id;

	attr.title = `流程${taskId.split('_')[1]} 信息确认`;
	attr.content = '请编辑信息确认模版';
	if (isValidWorkstepDoData(store, taskId)) {
		attr.content = formatContent(store.state.workflow.worksteps[taskId].do.data);
	} else if (isValidWorkstepDoVideo(store, taskId)) {
		attr.content = '播报视频: ' + store.state.workflow.worksteps[taskId].do.video.fileName;
	}
	if (store.state.workflow.worksteps[taskId]) {
		attr.rectColor = setRectColor(store, taskId);
		attr.desc = store.state.workflow.worksteps[taskId].name || '';
	}

	return drawNode(parentNode, element, textRenderer, eventBus, attr);
};

export default {
	drawShape,
	name: name
};
